#include <stdio.h>
#include <ctype.h>
#define MAX 255
int main() {
    char string[MAX], this;
    int i = 0;

    scanf("%s", string);
    while (string[i] != '\0') {
        this = string[i];
        if (this >= 'A' && this <= 'Z') {
            string[i] = tolower(string[i]);
        } else if (this >= 'a' && this <= 'z') {
            string[i] = toupper(string[i]);
        }
        i++;
    }
    
    printf("%s\n", string);
    return 0;
}

